import JSEncrypt from 'jsencrypt'

const encryptor = new JSEncrypt()

const pubKey = `-----BEGIN PUBLIC KEY-----MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyRldRyDMGS+T/s9zBjBGm89LAqgu+bv4zNs5MxWi+bCUtSaxt09EhTarS6tEgQbgxoJAJRD2vrvvn5Aj42TasogyQ6O5BD+XhpShcG614gRzKGYEpnv6HiVCwf1v/BQH7AKkcQV38aPRCUKMJAsaJcuvpsZTEmXucnamSFOvzktPYq5q0T1SVdhYwqQrWRCaddVvYRQuNl2w7pT9Hr2l164Y3uf8gkWz1BJvJWxcNSXtOZThZQnSb+NC59mqqk/DZ5tZjMaTy5NEcoyI+E4tYOEKSmQTpRXKrAbzSc1uuWlHGGwEyGS6TN336H4PSqHIBsqWkKH6W4ZZCQMVE3N5nDVe/HmHjC6QkB/C3JBbK374NE4TS30vwK3Eyn0XB/W/sVNPYHtWH6v+SXkwq507nkDLz6wubXR9hzKd3TlEpAnEMKTS+4pv4Hbi17cqVwniigXTXSBenovsISguIAm2GPrzO1rEWlH1End44f8yrmq3UF3D9rc+CT9+dbpgQDelSx4YU6HWKEmbkPA9ag1nEdZvIiVvfTJiAvjh6JeFsYYMNuOm2di0Q4WUe7vC17VOId62eD3UW4cqdbOM1jZv8qTnJOwn4SN6swDWpY31kUCUUFYi0i4KM0I2aG5TUwsDW8NiBuOtRatQr8ohVPtNUWnisGMCaGvz/WoNkoh19YUCAwEAAQ==-----END PUBLIC KEY-----`

encryptor.setPublicKey(pubKey)

export const encryptedData = data=> {
    return encryptor.encrypt(data)
}
